<%
String f = (String) request.getAttribute("f");
String pr = (String)request.getAttribute("pr");
String domain = (String)request.getAttribute("name");
pr = pr.replaceAll("[^0-9]","");
if(pr.equals(""))
	pr="0";
if("xml".equals(f))
{
	response.addHeader("Content-type","text/xml");
	out.print("<?xml version='1.0' encoding='ISO-8859-1'?>");
	out.print("<pr>");
	out.print(pr);
	out.print("</pr>");
} else if("json".equals(f)) {
	out.print( "{ \"url\":\"http://"+domain+"\" ,\"pagerank\":\""+pr+"\"}");
} else if("text".equals(f)) {
	out.print(pr);
} else {
	response.sendRedirect("images/"+pr+".gif");
}
%>